
#ifndef TP_EVENT_H
#define TP_EVENT_H

TP_DECL_BEGIN

typedef enum _TpEventType
{
	TP_EVENT_NOP,
	TP_EVENT_KEY_DOWN,
	TP_EVENT_KEY_UP,
	TP_EVENT_LBUTTON_DOWN,
	TP_EVENT_LBUTTON_UP,
	TP_EVENT_MOUSE_MOVE,
	TP_EVENT_WIDGET_SHOW,
	TP_EVENT_ADD_SOURCE,
	TP_EVENT_REMOVE_SOURCE,
}TpEventType;

typedef struct _TpEvent
{
	int type;
	union _TpEvt
	{
		struct _TpKeyEvt
		{
			int code;
		}key;
		struct _TpMouseEvt
		{
			int x;
			int y;
		}mouse;
		struct _TpWidgetEvt
		{
			void* widget;
			int is_show;
		}widget;
		void* source;
	}u_event;
}TpEvent;

typedef TpRet (*TpOnEvent)(void* user_data, TpEvent* event);

TP_DECL_END

#endif /* TP_EVENT_H */